﻿using System;

namespace FirstFloor.P2P
{
    /// <summary>
    /// Represents a p2p user.
    /// </summary>
    public class P2PUser
    {
        private string email;
        private string globalIp;
        private string localIp;
        private string name;
        private string puid;
        private bool isMe;
        private bool isInviter;

        /// <summary>
        /// Initializes a new instance of the <see cref="P2PUser"/> class.
        /// </summary>
        /// <param name="email">The email.</param>
        /// <param name="globalIp">The global ip.</param>
        /// <param name="localIp">The local ip.</param>
        /// <param name="name">The name.</param>
        /// <param name="puid">The puid.</param>
        /// <param name="isMe">if set to <c>true</c> [is me].</param>
        /// <param name="isInviter">if set to <c>true</c> [is inviter].</param>
        internal P2PUser(string email, string globalIp, string localIp, string name, string puid, bool isMe, bool isInviter)
        {
            this.email = email;
            this.globalIp = globalIp;
            this.localIp = localIp;
            this.name = name;
            this.puid = puid;
            this.isMe = isMe;
            this.isInviter = isInviter;
        }

        /// <summary>
        /// Gets the email.
        /// </summary>
        /// <value>The email.</value>
        public string Email
        {
            get { return this.email; }
        }

        /// <summary>
        /// Gets the global IP address.
        /// </summary>
        /// <value>The global IP.</value>
        public string GlobalIP
        {
            get { return this.globalIp; }
        }

        /// <summary>
        /// Gets the local IP address.
        /// </summary>
        /// <value>The local IP.</value>
        public string LocalIP
        {
            get { return this.localIp; }
        }

        /// <summary>
        /// Gets the name.
        /// </summary>
        /// <value>The name.</value>
        public string Name
        {
            get { return this.name; }
        }

        /// <summary>
        /// Gets the Passport Unique ID of the user.
        /// </summary>
        /// <value>The PUID.</value>
        public string PUID
        {
            get { return this.puid; }
        }

        /// <summary>
        /// Gets a value indicating whether this user instance is the local user.
        /// </summary>
        /// <value><c>true</c> if this instance is the local user; otherwise, <c>false</c>.</value>
        public bool IsMe
        {
            get { return this.isMe; }
        }

        /// <summary>
        /// Gets a value indicating whether this user instance is the inviter.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is the inviter; otherwise, <c>false</c>.
        /// </value>
        public bool IsInviter
        {
            get { return this.isInviter; }
        }
    }
}
